package com.xca.touchdemo;

import android.view.View;
import android.widget.Button;

import com.xca.touchdemo.base.BaseActivity;
import com.xca.touchdemo.view.MultiSignatureView;

public class MultiWriteActivity extends BaseActivity implements View.OnClickListener {
    private Button clear1 , save1 ;
    private MultiSignatureView multiSignatureView ;

    @Override
    public void onClick(View v) {
        if (isFastClick()){
            showToast("请勿连续快速点击");
            return;
        }
        int id = v.getId() ;
        if (id == R.id.clear1){
            multiSignatureView.clear();
        } else if (id == R.id.save1) {
            multiSignatureView.save();
            multiSignatureView.saveImageToGallery();
        }
    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_write;
    }

    @Override
    public void init() {
        clear1 = findViewById(R.id.clear1) ;
        save1 = findViewById(R.id.save1) ;
        multiSignatureView = findViewById(R.id.multiSignature);
        clear1.setOnClickListener(this);
        save1.setOnClickListener(this);
    }
}
